home *** CD-ROM | disk | FTP | other *** search
/ An Invitation to the Roland World of Music / Roland - An Invitation To The Roland World Of Music.bin / vb / vb30 / disk1 / multi.fr_ / multi.bin
Text File  |  1993-04-27  |  3KB  |  93 lines

  1. VERSION 2.00
  2. Begin Form frmMulti 
  3.    Caption         =   "Multi-column List Box"
  4.    Height          =   5220
  5.    Left            =   600
  6.    LinkTopic       =   "Form2"
  7.    ScaleHeight     =   4815
  8.    ScaleWidth      =   8295
  9.    Top             =   1155
  10.    Width           =   8415
  11.    Begin CommandButton cmdClear 
  12.       Caption         =   "C&lear"
  13.       Height          =   495
  14.       Left            =   6480
  15.       TabIndex        =   4
  16.       Top             =   1440
  17.       Width           =   1215
  18.    End
  19.    Begin CommandButton cmdClose 
  20.       Caption         =   "&Close"
  21.       Height          =   495
  22.       Left            =   6480
  23.       TabIndex        =   3
  24.       Top             =   2760
  25.       Width           =   1215
  26.    End
  27.    Begin CommandButton cmdTransfer 
  28.       Caption         =   "&Transfer"
  29.       Default         =   -1  'True
  30.       Height          =   495
  31.       Left            =   6480
  32.       TabIndex        =   2
  33.       Top             =   600
  34.       Width           =   1215
  35.    End
  36.    Begin ListBox lstBottom 
  37.       Height          =   1590
  38.       Left            =   600
  39.       TabIndex        =   1
  40.       Top             =   2400
  41.       Width           =   5295
  42.    End
  43.    Begin ListBox lstTop 
  44.       Columns         =   2
  45.       Height          =   1590
  46.       Left            =   600
  47.       MultiSelect     =   2  'Extended
  48.       TabIndex        =   0
  49.       Top             =   480
  50.       Width           =   5295
  51.    End
  52. End
  53.  
  54. Sub cmdClear_Click ()
  55.     lstBottom.Clear
  56.     cmdClear.Enabled = False        ' Bottom list now empty, so disable Clear button.
  57. End Sub
  58.  
  59. Sub cmdClose_Click ()
  60.    Unload Me    ' Unload this form.
  61. End Sub
  62.  
  63. Sub cmdTransfer_Click ()
  64.     For n = 0 To (lstTop.ListCount - 1)
  65.         If lstTop.Selected(n) = True Then       ' If selected, then
  66.             lstBottom.AddItem lstTop.List(n)    ' add to bottom list.
  67.         End If
  68.     Next
  69.     cmdClear.Enabled = True     ' Something now in bottom list, so enable Clear button.
  70. End Sub
  71.  
  72. Sub Form_Load ()
  73. ' Note that Sorted property of lstTop is True, so adding
  74. ' items in alphabetical order is not actually necessary.
  75.     lstTop.AddItem "Acme Pavers"
  76.     lstTop.AddItem "Belding and Associates"
  77.     lstTop.AddItem "Banyan II, Inc."
  78.     lstTop.AddItem "Feldspar, Feldspar, and Feldspar"
  79.     lstTop.AddItem "Gold Dusters Housecleaning"
  80.     lstTop.AddItem "MS Brothers Bakery"
  81.     lstTop.AddItem "Northwind Traders"
  82.     lstTop.AddItem "Sandor Cinemas"
  83.     lstTop.AddItem "Tastings Catering"
  84.     lstTop.AddItem "Tang and Ng, CPAs"
  85.     lstTop.Selected(0) = True   ' Select a couple of items
  86.     lstTop.Selected(1) = True   ' as a suggestion.
  87. End Sub
  88.  
  89. Sub lstTop_DblClick ()
  90.     cmdTransfer.Value = True    ' Press Transfer button.
  91. End Sub
  92.  
  93.